<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body onload="f()">
<script>
window.onload = f;
function f(){
    alert("页面加载完毕");
}
</script>
</body>

</html>
 